﻿using System;
using QFramework;

namespace HKTools
{
    public class CMD_CreateStopwatch : AbstractCommand<HK_Stopwatch>
    {
        float totalTime;

        Action onCountdownEnd;

        public CMD_CreateStopwatch(float totalTime, Action onCountdownEnd)
        {
            this.totalTime = totalTime;
            this.onCountdownEnd = onCountdownEnd;
        }

        protected override HK_Stopwatch OnExecute()
        {
            HK_Stopwatch stopwatch = this.GetSystem<IHK_StopwatchSystem>().CreateStopwatch(totalTime, onCountdownEnd);
            return stopwatch;
        }
    }
}